<html>
<head>
   <script src="../../Grid/GridE.js"> </script>
</head>
<body class="Tutorial">  
   <script>

Grids.OnTip = function(G,row,col,tip){
if(col=="A"){
   return "A = "+Get(row,"A")+", B = "+Get(row,"B")+", C = "+Get(row,"C")+", D = "+Get(row,"D")+", E = "+Get(row,"E");
   }
return tip;
}   
   
   </script>

   <style>
      /* Tutorial shared styles */
      .Tutorial h1,.Tutorial h2,.Tutorial ul,.Tutorial .Desc,.Tutorial .Path,.Tutorial .Xml { max-height:999999px; }
      .Tutorial h1 { font:30px Arial; padding:5px 0px 5px 0px; margin:0px; text-align:center; }
      .Tutorial h2 { font:15px Arial; padding:0px; margin:0px 0px 10px 0px; text-align:center; color:#757575; }
      .Tutorial h3,.Tutorial h4 { display:inline-block; font:bold 15px Arial; padding:0px 5px 0px 5px; border-radius:2px; color:black; margin:2px; font-style:normal; color:#333; }
      .Tutorial h3 { background:#EE9; border:1px solid #DD8; }
      .Tutorial h4 { background:#BDE; border:1px solid #ACD; }
      .Tutorial a { text-decoration:underline; }      
      .Tutorial li { padding-bottom:8px; }
      .Tutorial ul { margin:6px 0px 0px 20px; font:13px Arial; }
      .Tutorial > ul { margin-left:0px; padding-left:15px; clear:both; }
      .Tutorial ul b { color:#0585B9; }
      .Tutorial .Path { font:normal 12px Arial; color:#0585B9; }
      .Tutorial .Path b { color:#D73938; }
      .Tutorial .Path u { text-decoration:none; color:black; font-weight:bold; padding:0px 2px 0px 2px; }
      .Tutorial .Xml { margin-bottom:6px; font-size:12px; color:#757575; }
      .Tutorial .Border { border:1px solid #dfdfdf; padding:10px 20px 10px 20px; margin:0px 8px 20px 0px; min-width:100%; box-sizing:border-box; overflow:hidden; }
      .Tutorial .Main { }
   </style>

   <center class="Path"><script>document.write(location.href.replace(/(.*)(\/Tutorials\/)([^\/]+)\/([^\/]+)$/,"$2<b>$3</b>/$4").replace(/([^<]|^)(\/|\.)/g,"$1<u>$2</u>"));</script></center>
   <h1>10. Column and row spanning</h1>
   <h2>Attributes RowSpan, Span and Merge</h2>

   <center class="Border" id="Border">
      <div style="float:left; margin-right:20px; margin-bottom:20px;">
         <div class='Xml'>Source: <a href='10-Span.js'>10-Span.js</a></div>
         <div class="Main" style='width:753px; height:313px;'>
            <bdo Debug='check' Data_Url='10-Span.js'></bdo>
         </div>
      </div>
      <div style="float:left;">
         <div class='Xml'>Source: <a href='10-Span_header.js'>10-Span_header.js</a></div>
         <div class="Main" style='width:375px; height:271px; margin-bottom:20px;'>
            <bdo Debug='check' Data_Url='10-Span_header.js'></bdo>
         </div>
      </div>
   </center>

   <ul>
      <li>
         <h3>Span</h3> attribute specifies how many columns in the row will the cell span.
         The row must have set <b>Spanned='1'</b>, otherwise the Span attribute is ignored.
      </li>
      <li>
         If you permit column moving by users in spanned grid, it is recommended to define column groups by <b>Group</b> attribute to not let users to break down the spanned cells.
      </li>
      <li><h3>Merge</h3> attribute specifies the cell values which will be shown in the spanned cell.<br />
         By default only the first column value is shown in the spanned cell. The Merge contains a list of column names to display their values.
         The merged cell values can be displayed in any order.<br />
         By <b>MergeEdit</b> attribute is possible to specify the one editable cell from the Merge list.<br />
         By <b>MergeFormat</b> is possible to define exact structure how the cell values will be merged and displayed.<br />
         By <b>MergeEditFormat</b> specifies exact structure for editing, when more merged cells are editable.<br />
         For complex MergeFormat can be defined API event <b>OnMergeChanged</b> for custom parsing edited value instead of default one for given MergeEditFormat.<br />
      </li>
      <li>
         <h3>RowSpan</h3> attribute specifies how many rows in the column will the cell span.
         The column must have set <b>Spanned='1'</b>, otherwise the RowSpan attribute is ignored.
         In tree the RowSpan is a count of rows on the same level as this row. All their children are spanned automatically.
         The last row's children are spanned within range when added 0.5 to the RowSpan, e.g. RowSpan='3.5' means span for three row and also the last row's children.
      </li>
      <li><h4>Custom spanned section</h4> can be defined by <b>LeftHtml</b>, <b>MidHtml</b> and <b>RightHtml</b>.
      It spans all columns in the section and shows here the HTML code.
      </li>
      
      <li><h4>Header</h4> can be spanned and row spanned like any other rows.<br /> 
      Every grid contains one main header that is defined by root tag &lt;Header>. You can define more headers by placing next &lt;Header> tags into &lt;Head> section.<br />
      To control position of the main header inside the other headers place it also to &lt;Head> tag as &lt;Header id='Header'/>.
      </li>
      <li>
      If used <h4>column paging</h4> (&lt;Cfg ColPaging/> ), the cells can be spanned only inside the column page.<br />
      You can set <b>&lt;Cfg ColPagingFixed='0'/></b> to not page fixed rows and let them span through the whole body.<br />
      </li>
      <li>To center text inside horizontally spanned cell regardless on scrolling set cell attribute <b>Align='Scroll'</b>.</li>
   </ul>

   <!-- Google Analytics code run once for trial -->
   <script>
      var TGTrial = document.cookie.match(/TGTrialCells\s*=\s*(\d+)/), TGIndex = 512;
      if(!TGTrial||!(TGTrial[1]&TGIndex)) setTimeout(function(){
         var n = "RunTrialGridCells10", d = (new Date((new Date).getTime()+31536000000)).toUTCString(); document.cookie = "TGTrialCells="+((TGTrial?TGTrial[1]:0)|TGIndex)+";expires="+d;
         var u = document.cookie.match(/TGTrialUsed\s*=\s*(\d+)/); u = u ? u[1]-0+1 : 1; if(u<=11) document.cookie = "TGTrialUsed="+u+";path=/;expires="+d;
         var s = "<div style='width:0px;height:0px;overflow:hidden;'><iframe src='http"+(document.location.protocol=="https"?"s":"")+"://www.treegrid.com/Stat/GA.html?productName="
               +(u==1||u==3||u==5||u==10?"UsedTrial"+u:n)+"' onload='var T=this;setTimeout(function(){document.body.removeChild(T.parentNode.parentNode);},1000);'/></div>";
         var F = document.createElement("div"); F.innerHTML = s; document.body.appendChild(F);
         },100);
   </script>
</body>
</html>